package com.dwxt.sport.business.entity;

import com.dwxt.sport.util.DictUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "t_video_surveillance")
public class VideoSurveillance {

    @Id
    private String id;

    /**
     * 设备名称
     */
    @ApiModelProperty("设备名称")
    private String name;

    /**
     * 设备类型
     */
    @Column(name = "equipment_type")
    private String unitType;

    @ApiModelProperty("设备类型Display")
    public String getUnitTypeDisplay(){
        return unitType==null ? null : DictUtil.getDisplay("deviceType",unitType);
    }

    /**
     * 极限人数
     */
    @ApiModelProperty("极限人数")
    private Integer limitation;

    /**
     * 运动面积
     */
    @ApiModelProperty("运动面积")
    @Column(name = "sports_area")
    private BigDecimal sportsArea;

    /**
     * 设备位置
     */
    @ApiModelProperty("设备位置")
    @Column(name = "equipment_location")
    private String equipmentLocation;

    /**
     * 波流地址
     */
    @ApiModelProperty("波流地址")
    @Column(name = "wave_current_address")
    private String waveCurrentAddress;

    /**
     * 设备区域
     */
    @Column(name = "equipment_area")
    @ApiModelProperty("设备区域")
    private String equipmentArea;

    @ApiModelProperty("设备区域Display")
    public String getEquipmentAreaDisplay(){
        if(equipmentArea==null){
            return null;
        }
        return DictUtil.getDisplay("equipmentArea",equipmentArea);
    }

    /**
     * 运动类型
     */
    @Column(name = "motion_type")
    @ApiModelProperty("运动类型")
    private String motionType;

    @ApiModelProperty("运动类型Display")
    public String getMotionTypeDisplay(){
        if(motionType!=null){
            return DictUtil.getDisplay("motionType",motionType);
        }
        return null;
    }

    /**
     * 逻辑删除标识(0否1是)
     */
    @Column(name = "is_delete")
    private String isDelete;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @Column(name = "create_user_id")
    private String createUserId;

    /**
     * (最近)更新时间
     */
    @Column(name = "update_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty("(最近)更新时间")
    private LocalDateTime updateTime;

    /**
     * 更新人id
     */
    @Column(name = "update_user_id")
    private String updateUserId;

    /**
     * 备用字段1
     */
    private String attr1;

    /**
     * 备用字段2
     */
    private String attr2;

    /**
     * 备用字段3
     */
    private String attr3;

    /**
     * 备用字段4
     */
    private String attr4;


}